// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';

/** 获取人员列表  */
export async function getUserInfoList(params: any) {
  return request('/api/v1/user/getUserInfoList', {
    method: 'POST',
    params: {
      page: params.page,
      pageSize: params.pageSize,
    },
    data: params,
  });
}

/** 获取人员列表BY ID  */
export async function getUserInfoById(params: any) {
  return request('/api/v1/user/getUserInfoById', {
    method: 'GET',
    params: {
      ...params,
    },
  });
}

/** 修改人员  */
export async function updateUserInfo(params: any) {
  return request('/api/v1/user/updateUserInfo', {
    method: 'POST',
    data: params,
  });
}

/** 新建人员 */
export async function createUser(params: any) {
  return request('/api/v1/user/createUser', {
    method: 'POST',
    data: params,
  });
}

/** 删除人员  */
export async function deleteUserInfo(params: any) {
  return request('/api/v1/user/deleteUserInfo', {
    method: 'POST',
    params: params,
  });
}

/** 禁用人员  */
export async function disableUserInfo(params: any) {
  return request('/api/v1/user/disableUserInfo', {
    method: 'POST',
    params: params,
  });
}

/** 审核人员  */
export async function approveUserInfo(params: any) {
  return request('/api/v1/user/approveUserInfo', {
    method: 'POST',
    params: params,
  });
}

/** 头像上传  */
export async function uploadAvatar(params: any) {
  return request('/api/v1/user/uploadAvatar', {
    method: 'POST',
    data: { avatarBase64: params.avatarBase64 },
    params: {
      id: params.id,
    },
  });
}

/** 同步 */
export async function syncUser() {
  return request('/api/v1/user/syncUser', {
    method: 'POST',
  });
}
